<?
class Services_Controller_Plugin_ViewSetup extends Zend_Controller_Plugin_Abstract
{
	protected $_view;
	
	public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
	{
		$viewRenderer = Zend_Controller_Action_HelperBroker::
                  getStaticHelper('viewRenderer');
				  
		$viewRenderer->init();
		$view = $viewRenderer->view;
		$this->_view = $view;
		
		// set up common variables for the view
		$view->module = $request->getModuleName();
		$view->controller = $request->getControllerName();
		$view->action = $request->getActionName();
		
		// add helper path to Places View/Helper directory
		$prefix = 'Services_View_Helper';
		$dir = dirname(__FILE__) . '/../../View/Helper';
		$view->addHelperPath($dir, $prefix);
	}
}